package com.wa.es.constant;


/**
 * @Description: elastic search dsl query 常量
 * @Author: Richard Zhan
 * @Date: 2019/11/27
 **/
public class ElasticQueryConstant {


    //控制识别精度
    public static final int MINIMUM_NUMBER_SHOULD_MATCH = 1;

    //未知参数
    public static final String UN_KNOWN = "unknown";

    //ik分词器 分词类型
    public static final String ANALYSIS_IK_MAX_WORD = "ik_max_word";
    public static final String ANALYSIS_IK_SMART = "ik_smart";
    //hanLP分词器 标准分词
    public static final String ANALYSIS_HANLP_STANDARD = "hanlp_standard";
    public static final String ANALYSIS_HANLP_CUSTOMER = "customer_hanlp_index_analyzer";
    //ES默认空白分隔符分词器
    public static final String ANALYSIS_BUILD_IN_WHITESPACE = "whitespace";
    //ES自定义分隔符分词器
    public static final String ANALYSIS_WARE_DESC = "ware_desc_analyzer";
    //ES自定义分隔符分词器
    public static final String ANALYSIS_PRODUCT_DESC = "product_desc_analyzer";
    //空格
    public static final String SPACE = " ";
    //下划线
    public static final String UNDER_LINE = "_";

    //标准时间格式
    public static final String STANDARD_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";

    /**
     * boost 参数被用来提升一个语句的相对权重（ boost 值大于 1 ）
     * 或降低相对权重（ boost 值处于 0 到 1 之间），但是这种提升或降低并不是线性的，
     * 换句话说，如果一个 boost 值为 2 ，并不能获得两倍的评分 _score 。
     */
    public static final float BOOST_1 = 1;
    public static final float BOOST_2 = 2;
    public static final float BOOST_3 = 3;
    public static final float BOOST_4 = 4;
    public static final float BOOST_10 = 10;
    public static final float BOOST_100 = 100;
    public static final float BOOST_200 = 200;
    public static final float BOOST_400 = 400;
    public static final float BOOST_HALF = 0.5f;
    //允许识别品牌数量
    public static final int MAX_BRAND_SIZE = 3;
    //邻近查询 允许精确短语匹配词条可移动范围
    public static final int SLOP_10 = 10;

    //如果文档没有该字段，则使用该值. 就像从文档中读取一样，修饰符和因数仍然适用于它.
    public static final Double FIELD_VALUE_FACTOR_MISSING_VALUE = 1D;


    //weight 为每个文档应用一个简单的而不被正则化的权重提升值:当 weight 为 2 时，最终结果为 2 * _score
    public static final int FUNCTION_SCORE_WEIGHT = 100;
    public static final int FUNCTION_SCORE_WEIGHT_200 = 200;
    public static final int FUNCTION_SCORE_WEIGHT_10 = 10;


    //window size
    public static final int WINDOW_SIZE_10000 = 10000;
    public static final int WINDOW_SIZE_1000 = 1000;
    public static final int WINDOW_SIZE_200 = 200;
    public static final int WINDOW_SIZE_100 = 100;
    public static final int WINDOW_SIZE_50 = 50;




    //映射关系key
    public static final String PROPERTY_NAME = "propertyName";
    public static final String PROPERTY_ALIAS = "propertyAlias";


    //型号
    public static final String PART_NUMBER = "partNumber";
    //不分词型号 用于精准查询
    public static final String PART_NUMBER_NOT_ANALYZED_RAW = "partNumber.rawPartNumber";
    //不分词型号别名
    public static final String PART_NUMBER_ALIAS_NOT_ANALYZED_RAW = "partNumberAliasList.partNumberAlias.keyword";
    //参数描述
    public static final String PART_DESC = "partDesc";
    //品牌
    public static final String BRAND_ID = "brandId";
    //电阻
    public static final String RES_VALUE = "resValue";
    //电容
    public static final String CAP_VALUE = "capValue";
    //封装 in
    public static final String ENCAPSULATION_IN = "encapsulationIn";
    //封装 mm
    public static final String ENCAPSULATION_MM = "encapsulationMm";
    //容差 +
    public static final String TOLERANCE_POSITIVE = "tolerancePositive";
    //容差 -
    public static final String TOLERANCE_NEGATIVE = "toleranceNegative";
    //电压功率
    public static final String VOLTAGE_DC_VALUE = "voltageDcValue";


    //供应商代码
    public static final String VENDOR_CODE_KEY = "vendorCode";
    //id
    public static final String ID_KEY = "id";

    //交期单位
    public static final String DELIVERY_CN_UNIT = "deliveryCnUnit";
    public static final String DELIVERY_HK_UNIT = "deliveryHkUnit";


    //排序常量
    public static final String MIN_WARE_PRICE_SORT = "minWarePrice";
    public static final String MAX_WARE_PRICE_SORT = "maxWarePrice";

    public static final String MIN_DELIVERY_DAYS_SORT = "minDeliveryDays";


    public static final String PRICE_LIST_NESTED_SORT = "priceList.price";
    public static final String PRICE_LIST_NESTED = "priceList";

    //需求数量
    public static final String WARE_QUANTITY = "quantity";

    //入驻类型 10 入驻开店 20 平台代售 30 海外 40 自营
    public static final String ENTER_STYLE = "enterStyle";
    //交货地 CN HK
    public static final String DELIVERY_PLACE = "deliveryPlace";
    public static final String DELIVERY_PLACE_CN = "CN";
    public static final String DELIVERY_PLACE_HK = "HK";

    //参数描述(包含商品所有清洗的参数 商品主要参数+商品次要参数)
    public static final String PARAM_DESC = "paramDesc";
    //商品主要参数
    public static final String NECESSARY_PARAM_DESC = "necessaryParam";
    //商品次要参数
    public static final String SECONDARY_PARAM_DESC = "secondaryParam";
    //分类
    public static final String CATEGORY_NAME_SEPARATE = "categoryNameSeparate";
    //最短国内交期
    public static final String MIN_DELIVERY_CN_DAYS = "minDeliveryCnDays";
    //最短香港交期
    public static final String MIN_DELIVERY_HK_DAYS = "minDeliveryHkDays";
}
